<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - Bootstrap Table</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link rel="shortcut icon" href="favicon.ico"> 
    <!-- <link th:href="@{/css/ace.min.css}" rel="stylesheet"> -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet">
    <link th:href="@{/css/plugins/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet">
    <link th:href="@{/css/animate.css}" rel="stylesheet">
    <link th:href="@{/css/style.css}" rel="stylesheet">
    <style type="text/css">
    	.b{
    		margin-bottom: 0px;
    	}
    	.fixed-table-container{
    	  padding-bottom: 80px !important;
    	}
    </style>
</head>
<body class="no-skin">
    <div class="wrapper wrapper-content animated fadeInRight">
        <!-- Panel Other -->
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                    	<div>
	                    	<form id="searchFrm" class="form-horizontal" role="form">
									<div class="form-group b">
										<label class="col-sm-1 control-label" >用户姓名</label>
										<div class="col-sm-2">
											<input type="text" id="selectUserName" placeholder="用户姓名" class="form-control" onkeydown="javascript:if(event.keyCode==13){search();return false};"/>
										</div>
				
										<label class="col-sm-1 control-label">状态</label>
										<div class="col-sm-2">
											<select id="selectStatus" name="attendanceType" class="form-control m-b">
												<option value="">--请选择--</option>
												<option value="1">正常</option>
												<option value="2">冻结</option>
											</select>
										</div>
										<label class="col-sm-1 control-label" >开始日期</label>
										<div class="col-sm-2">
										    <input placeholder="创建开始日期" class="form-control layer-date" id="start" >
										</div>
										<label class="col-sm-1 control-label" >结束日期</label>
										<div class="col-sm-2">
										    <input placeholder="创建结束日期" class="form-control layer-date" id="end">
										</div>
									</div>
									<div align="right" style="margin-top: 8px">
										<button class="btn btn-sm btn-info" type="button" onclick="search();">
											<i class="ace-icon fa fa-share"></i>
												查询
										</button>
										<button class="btn btn-sm btn-info" type="button" onclick="resets();">
											<i class="ace-icon fa fa-share"></i>
												清空
										</button>
									</div>
								</form>
                    	</div>
                        <div style="margin: 5px 0px 0px 0px;padding: 5px 4px;background: #e7eaec">
                        	<shiro:hasPermission name="sys:user:add">
                         		<button class="btn btn-success  btn-sm" type="button" onclick="addUser()"><i class="fa fa-plus"></i> <span class="bold">新增</span></button>
                       		</shiro:hasPermission>
                        	<shiro:hasPermission name="sys:user:update">
                         		<button class="btn btn-info btn-sm" type="button" onclick="editUser()"><i class="fa fa-paste"></i> <span class="bold">编辑</span></button>
                       		</shiro:hasPermission>
                        	<shiro:hasPermission name="sys:user:roleToUser">
                         		<button class="btn btn-warning btn-sm" type="button" onclick="roleToUser()"><i class="fa fa-odnoklassniki-square"></i> <span class="bold">授权</span> </button>
                       		</shiro:hasPermission>
                        	<shiro:hasPermission name="sys:user:delete">
                         		<button class="btn btn-danger  btn-sm" type="button" onclick="deleteUser()"><i class="fa fa-trash-o"></i> <span class="bold">删除</span</button>
                       		</shiro:hasPermission>
                        </div>
                        <div>
                             <table id="userList" data-height="auto" data-mobile-responsive="true" style="margin-bottom: 50px">
                             </table> 
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- End Panel Other -->
    </div>
 <div class="modal fade" id="addUser" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
        <div class="modal-dialog" style="margin-top:10%">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                            &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabels">
                      	  添加用户
                    </h4>
                </div>
	                <form class="form-horizontal" action="/sysUser/addSysUser" method="post" id="addUserForm"  style="margin-top:10px">
		                <div class="modal-body">
			                    <div class="form-group">
			                    	    <label  class="col-sm-3 control-label">用户名称:</label>
					                    <div class="col-sm-6">
					                      	 <input type="text" class="form-control" id="userName" name="userName" placeholder="用户名称" value="" required="required"/>
					                    </div>
			                    </div>
			                    <div class="form-group">
			                    	    <label  class="col-sm-3 control-label">年龄:</label>
					                    <div class="col-sm-6">
					                      	 <input type="text" class="form-control" id="age" name="age" placeholder="年龄" value=""  required="required"/>
					                    </div>
			                    </div>
			                    <div class="form-group">
			                    	    <label  class="col-sm-3 control-label">密码:</label>
					                    <div class="col-sm-6">
					                      	 <input type="password" class="form-control" id="password" name="password" placeholder="密码" value=""  required="required"/>
					                    </div>
			                    </div>
			                    <div class="form-group">
			                    	    <label  class="col-sm-3 control-label">状态:</label>
					                    <div class="col-sm-6">
					                      	<select id="status" name="status" class="form-control m-b"  required="required">
												<option value="">--请选择--</option>
												<option value="1">正常</option>
												<option value="2">冻结</option>
											</select>
					                    </div>
			                    </div>
			             </div>
			             <div class="modal-footer">
		                     <button type="button" class="btn btn-default"  data-dismiss="modal">关闭</button>
		                     <button  class="btn btn-primary" type="submit">确定</button>
		                 </div>
	                </form>
            </div>
        </div>
    </div>
    
    <div class="modal fade" id="editUser" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
        <div class="modal-dialog" >
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                            &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabels">
                      	编辑用户
                    </h4>
                </div>
	            <form class="form-horizontal" action="/sysUser/editSysUser" method="post" id="editUserForm"  style="margin-top:10px">
	                <div class="modal-body">
		                	<input type="hidden" name="id" id="updateId">  
		                    <div class="form-group">
		                    	    <label  class="col-sm-3 control-label">用户名称:</label>
				                    <div class="col-sm-6">
				                      	 <input type="text" class="form-control" id="updateUserName" name="userName" placeholder="用户名称" value=""  required="required"/>
				                    </div>
		                    </div>
		                    <div class="form-group">
		                    	    <label  class="col-sm-3 control-label">年龄:</label>
				                    <div class="col-sm-6">
				                      	 <input type="text" class="form-control" id="updateAge" name="age" placeholder="年龄" value=""  required="required"/>
				                    </div>
		                    </div>
		                    <div class="form-group">
		                    	    <label  class="col-sm-3 control-label">密码:</label>
				                    <div class="col-sm-6">
				                      	 <input type="password" class="form-control" id="updatePassword" name="password" placeholder="密码" value=""  required="required"/>
				                    </div>
		                    </div>
		                    <div class="form-group">
		                    	    <label  class="col-sm-3 control-label">状态:</label>
				                    <div class="col-sm-6">
				                      	<select id="updateStatus" name="status" class="form-control m-b"  required="required">
											<option value="">--请选择--</option>
											<option value="1">正常</option>
											<option value="2">冻结</option>
										</select>
				                    </div>
		                    </div>
		            </div>    
	                <div class="modal-footer">
	                    <button type="button" class="btn btn-default"  data-dismiss="modal">关闭</button>
	                    <button  class="btn btn-primary" type="submit">确定</button>
	                </div>
	            </form>
            </div>
        </div>
    </div>
    
    <div class="modal fade" id="detailUser" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
        <div class="modal-dialog" >
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                            &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabels">
                      	用户详情
                    </h4>
                </div>
	            <form class="form-horizontal" action="" method="post" id="detailUserForm"  style="margin-top:10px">
	                <div class="modal-body">
		                    <div class="form-group">
		                    	    <label  class="col-sm-3 control-label">用户名称:</label>
				                    <div class="col-sm-6">
				                      	 <input type="text" class="form-control" id="detailUserName" name="userName" placeholder="用户名称" value="" disabled="disabled"/>
				                    </div>
		                    </div>
		                    <div class="form-group">
		                    	    <label  class="col-sm-3 control-label">年龄:</label>
				                    <div class="col-sm-6">
				                      	 <input type="text" class="form-control" id="detailAge" name="age" placeholder="年龄" value="" disabled="disabled"/>
				                    </div>
		                    </div>
		                    <div class="form-group">
		                    	    <label  class="col-sm-3 control-label">密码:</label>
				                    <div class="col-sm-6">
				                      	 <input type="password" class="form-control" id="detailPassword" name="password" placeholder="密码" value="" disabled="disabled"/>
				                    </div>
		                    </div>
		                    <div class="form-group">
		                    	    <label  class="col-sm-3 control-label">状态:</label>
				                    <div class="col-sm-6">
				                      	<select id="detailStatus" name="status" class="form-control m-b"  disabled="disabled">
											<option value="">--请选择--</option>
											<option value="1">正常</option>
											<option value="2">冻结</option>
										</select>
				                    </div>
		                    </div>
		            </div>    
		            <div class="modal-footer">
		                    <button type="button" class="btn btn-default"  data-dismiss="modal">关闭</button>
		            </div>
	            </form>
            </div>
        </div>
    </div>
    
     <div class="modal fade" id="roleToUser" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
        <div class="modal-dialog" >
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                            &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabels">
                      	角色列表
                    </h4>
                </div>
	                  <div>
		               		<div class="wrapper wrapper-content animated fadeInRight">
       						 <!-- Panel Other -->
						        <div class="ibox float-e-margins">
						            <div class="ibox-content">
						                <div class="row row-lg">
						                    <div class="col-sm-12">
						                        <div>
						                             <table id="roleList" data-height="auto" data-mobile-responsive="true"></table> 
						                        </div>
						                    </div>
						                </div>
						            </div>
						        </div>
						    </div>
		              </div>
		            <form class="form-horizontal" action="/sysUserRole/addUserRole" method="post" id="roleToUserForm"  onsubmit="return setRoleToUser()">
		            	<input id="userId" name="userId" type="hidden">
		            	<input id="roleId" name="roleIds"  type="hidden">
	                	<div class="modal-footer">
		                    <button type="button" class="btn btn-default"  data-dismiss="modal">关闭</button>
		                    <button  class="btn btn-primary" type="submit">确定</button>
		                </div>
		            </form>    	
            </div>
        </div>
    </div>

    <!-- 全局js -->
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/plugins/layer/layer.min.js}"></script>
    <script th:src="@{/js/plugins/layer/laydate/laydate.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/plugins/bootstrap-table/bootstrap-table.min.js}"></script>
    <script th:src="@{/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js}"></script>
    <script th:src="@{/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
    <!-- Peity -->
    <script th:src="@{/bootjs/user/userList.js}"></script>
    <script th:src="@{/bootjs/common/dateutil.js}"></script>

</body>

</html>
